(ns jna.win.guid
  (:use jna))

(deftype IID [^long Data1
              ^short Data2
              ^short Data3
              ^char Data4_0 ^char Data4_1 ^char Data4_2 ^char Data4_3]
  com.sun.jna.Structure$ByValue)

(deftype IID [^long mostSigBits
              ^long leastSigBits]
  com.sun.jna.Structure$ByValue)

;(jna-def-struct IID
;  [:LONGLONG :mostSigBits]
;  [:LONGLONG :leastSigBits])

(defn clsid [id]
  (let [uuid (java.util.UUID/fromString id)]
    ; XXX: ByValue, or ByReference?
    (mekit.types.win.IID$ByReference. (.getMostSignificantBits uuid) (.getLeastSignificantBits uuid))))
